/*
 * DungeonResource.h
 *
 *  Created on: 2013. 9. 3.
 *      Author: mega@gamevil.com
 */

#ifndef DUNGEONRESOURCE_H_
#define DUNGEONRESOURCE_H_

#include <map>

namespace ProjectZ { namespace NResource {

class DungeonData
{
public:
	struct Flyweight
	{
		int THEME;
		int DUNGEON;
		int OPEN_LV;
		int SIZE;
		int LENGTH;
		int STAMINA;
		int MOB1_TID;
		int MOB1_LV_NORMAL_NORMAL;
		int MOB1_LV_HARD;
		int MOB1_LV_HELL;
		int MOB1_LIMIT;
		int DROP1_ITEM1;
		int DROP1_ITEM2;
		int DROP1_ITEM3;
		int DROP1_ITEM4_TYPE;
		int DROP1_ITEM4;
		int	QUEST1_IDX;
		int QUEST1_ITEM;
		int EVENT1_ITEM_TYPE;
		int EVENT1_ITEM;
		int MOB2_TID;
		int MOB2_LV_NORMAL;
		int MOB2_LV_HARD;
		int MOB2_LV_HELL;
		int MOB2_LIMIT;
		int DROP2_ITEM1;
		int DROP2_ITEM2;
		int DROP2_ITEM3;
		int DROP2_ITEM4_TYPE;
		int DROP2_ITEM4;
		int	QUEST2_IDX;
		int QUEST2_ITEM;
		int EVENT2_ITEM_TYPE;
		int EVENT2_ITEM;
		int MOB3_TID;
		int MOB3_LV_NORMAL;
		int MOB3_LV_HARD;
		int MOB3_LV_HELL;
		int MOB3_LIMIT;
		int DROP3_ITEM1;
		int DROP3_ITEM2;
		int DROP3_ITEM3;
		int DROP3_ITEM4_TYPE;
		int DROP3_ITEM4;
		int	QUEST3_IDX;
		int QUEST3_ITEM;
		int EVENT3_ITEM_TYPE;
		int EVENT3_ITEM;
		int MOB4_TID;
		int MOB4_LV_NORMAL;
		int MOB4_LV_HARD;
		int MOB4_LV_HELL;
		int MOB4_LIMIT;
		int DROP4_ITEM1;
		int DROP4_ITEM2;
		int DROP4_ITEM3;
		int DROP4_ITEM4_TYPE;
		int DROP4_ITEM4;
		int	QUEST4_IDX;
		int QUEST4_ITEM;
		int EVENT4_ITEM_TYPE;
		int EVENT4_ITEM;
		int MOB5_TID;
		int MOB5_LV_NORMAL;
		int MOB5_LV_HARD;
		int MOB5_LV_HELL;
		int MOB5_LIMIT;
		int DROP5_ITEM1;
		int DROP5_ITEM2;
		int DROP5_ITEM3;
		int DROP5_ITEM4_TYPE;
		int DROP5_ITEM4;
		int	QUEST5_IDX;
		int QUEST5_ITEM;
		int EVENT5_ITEM_TYPE;
		int EVENT5_ITEM;
		int MOB6_TID;
		int MOB6_LV_NORMAL;
		int MOB6_LV_HARD;
		int MOB6_LV_HELL;
		int MOB6_LIMIT;
		int DROP6_ITEM1;
		int DROP6_ITEM2;
		int DROP6_ITEM3;
		int DROP6_ITEM4_TYPE;
		int DROP6_ITEM4;
		int	QUEST6_IDX;
		int QUEST6_ITEM;
		int EVENT6_ITEM_TYPE;
		int EVENT6_ITEM;
		int LEGEND_TID;
		int LEGEND_LV_NORMAL;
		int LEGEND_LV_HARD;
		int LEGEND_LV_HELL;
		int LEGEND_APPEAR_RATE;
		int DROP_LEGEND_ITEM1;
		int DROP_LEGEND_ITEM2;
		int DROP_LEGEND_ITEM3;
		int DROP_LEGEND_ITEM4_TYPE;
		int DROP_LEGEND_ITEM4;
		int	QUEST_LEGEND_IDX;
		int QUEST_LEGEND_ITEM;
		int EVENT_LEGEND_ITEM;
		int BOSS_MAP;
		int BOSS_TID;
		int BOSS_LV_NORMAL;
		int BOSS_LV_HARD;
		int BOSS_LV_HELL;
		int DROP_BOSS_ITEM1;
		int DROP_BOSS_ITEM2;
		int DROP_BOSS_ITEM3;
		int DROP_BOSS_ITEM4_TYPE;
		int DROP_BOSS_ITEM4;
		int DAY_ITEM_0;
		int DAY_ITEM_1;
		int DAY_ITEM_2;
		int DAY_ITEM_3;
		int DAY_ITEM_4;
		int DAY_ITEM_5;
		int DAY_ITEM_6;
		int DAY_ITEM_DROP_RATE;
		int DAY_ITEM_MAX_DROP;
		int EVENT_BOSS_TID;
		int DUNGEON_EXP;
		int DUNGEON_GOLD;
	};

public:
	DungeonData() {};
	virtual ~DungeonData();

	bool LoadResource(int company, int saleCode);
	Flyweight * GetFly(int dungeonid);

private:
	void	Clear();

private:
	typedef std::map<int, Flyweight *>	DATATREE;
	DATATREE	clsFlyTree;
};


class DungeonResource
{
public:
	DungeonResource();
	virtual ~DungeonResource();


	bool LoadResource();
	DungeonData::Flyweight * GetFly(int company, int saleCode, int dungeonid);

private:
	DungeonData * pDungeonAndroid;
	DungeonData * pDungeonIOS;
};

} /*NResource*/ } /* namespace ProjectZ */

#endif /* DUNGEONRESOURCE_H_ */
